<template>
  <div class="MainBody">
    <div class="MainContent">
        <el-header>{{ classname }}
            <span style="float: right;">{{ username }}</span>
        </el-header>
    <el-container style="height: 100vh; border: 1px solid #eee">
  <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
    <el-menu :default-openeds="['1', '3']">
        <el-menu-item index="1" @click="value=0"><i class="el-icon-s-order"></i>评分</el-menu-item>
        <el-menu-item index="2" @click="value=1" v-if="authority === '1'"><i class="el-icon-view"></i>查看</el-menu-item>
      <el-menu-item index="3" @click="value=2"><i class="el-icon-edit"></i>修改</el-menu-item>
    </el-menu>
  </el-aside>
  
  <el-container>
    
    <el-main class="Main">
        <div v-if="value === 0">
            <Main></Main>
        </div>

        <div v-if="value === 1">
        <!-- <PCList></PCList> -->
        <List></List>
        </div>
        <div v-if="value === 2">
          <ScoreUpdate></ScoreUpdate>
        </div>
    </el-main>
  </el-container>
</el-container>

</div>
  </div>
</template>

<script>
import Main from './comps/Main.vue';
// import PCList from './comps/PCList.vue';
// import PCList2 from './comps/PCList2.vue';
import List from './comps/List.vue';
import ScoreUpdate from './comps/ScoreUpdate.vue';
  export default {
    data() {

      const item = {};
      return {
        authority: localStorage.getItem('authority'),
        value: 0,
        // tableData: Array(20).fill(item),
        username: localStorage.getItem('chname'),
        classname: this.$route.params.titlename
      }
    },
    components: {
      Main,
      // PCList,
      // PCList2,
      List,
      ScoreUpdate
    }
  };
</script>

<style>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }

  .MainBody{
    display: flex;
  }
  .MainContent{
    flex: 8;
    margin: 0 10%;
  }
  .Main{
    padding: 0;
  }
</style>

